import RecommendGamesNode from "./RecommendGamesNode";
import PlatUtils from "./PlatUtils";
import { utils } from "./Utils";

const { ccclass, property } = cc._decorator;

@ccclass
export default class RecommendGamesWidget extends cc.Component {

    _recommendGamesNode: RecommendGamesNode = null;
    _isShow: boolean = false;

    onLoad() {
        this._recommendGamesNode = this.getComponentInChildren(RecommendGamesNode);
        this._recommendGamesNode.node.scale = 1.2;
        this._recommendGamesNode.node.active = false;
    }

    update(dt:number){
        if(PlatUtils.IsWechat && !this._isShow){
            if(utils.wechatTool && utils.wechatTool.configData){
                this._isShow = true;
                this._recommendGamesNode.node.active = true;
            }
        }
    }
}
